﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Threading.Tasks;
using BCCommon.OAEnums.TeamWork;
using BCEntity.OA.TeamWork.TeamWorkAttachment;

namespace BCData.OA.TeamWork.TeamWorkAttachment
{
    /// <summary>
    /// 协同办公附件
    /// </summary>
    public interface ITeamWorkAttachmentData
    {
        /// <summary>
        /// 是否存在该记录
        /// </summary>
        /// <param name="teamWorkAttachmentId">协同办公附件Id</param>
        Task<bool> Exists(long teamWorkAttachmentId);
        /// <summary>
        /// 增加协同办公附件
        /// </summary>
        /// <param name="entity">协同办公附件信息</param>
        Task<TeamWorkAttachmentEntity> Add(TeamWorkAttachmentEntity entity);
        /// <summary>
        /// 更新协同办公附件
        /// </summary>
        /// <param name="entity">协同办公附件信息</param>
        Task<TeamWorkAttachmentEntity> Update(TeamWorkAttachmentEntity entity);
        /// <summary>
        /// 删除协同办公附件
        /// </summary>
        /// <param name="teamWorkAttachmentId">协同办公附件Id</param>
        Task<bool> Delete(long teamWorkAttachmentId);
        /// <summary>
        /// 删除协同办公附件
        /// </summary>
        /// <param name="teamWorkId">协同办公Id</param>
        Task<bool> DeleteBatch(long teamWorkId);
        /// <summary>
        /// 获取协同办公附件
        /// </summary>
        /// <param name="teamWorkAttachmentId">协同办公附件Id</param>
        Task<TeamWorkAttachmentEntity> GetEntity(long teamWorkAttachmentId);
        /// <summary>
        /// 获取协同办公附件列表
        /// </summary>
        /// <param name="teamWorkId">协同办公Id</param>
        Task<IEnumerable<TeamWorkAttachmentEntity>> GetList(long teamWorkId);
        /// <summary>
        /// 获取协同办公附件分页列表
        /// </summary>
        /// <param name="teamWorkId">协同办公Id</param>
        /// <param name="fileSourceType">附件来源类型</param>
        /// <param name="start">开始时间</param>
        /// <param name="end">结束时间</param>
        /// <param name="pageIndex">当前页码</param>
        /// <param name="pageSize">每页数据条数</param>
        Task<(IEnumerable<TeamWorkAttachmentEntity>, int)> Query(long? teamWorkId, OATeamWorkFileSourceType? fileSourceType, DateTime? start, DateTime? end, int pageIndex, int pageSize);
    }
}